# 大数据作业第一题
# author ：lbc
hadoop fs -test -e input/input.txt
if [ $? -ne 0 ]; then
    echo "Directory not exists!"
    hadoop fs -put /root/homework/h1/input.txt input

else
    echo "File already exist!"
    if [ $1 = "-a" ];then 
        hadoop fs -appendToFile /root/homework/h1/input.txt input/input.txt
    fi
    if [ $1 = "-f" ];then 
        hadoop fs -rm input/input.txt
        hadoop fs -put /root/homework/h1/input.txt input
    fi
fi
